<?php
/**
 * @package Joomla
 * @subpackage Jmonoslideshow
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jmonoslideshow is a Joomla extension for Monoslideshow.
 *
 * Jmonoslideshow uses :
 * Monoslideshow (http://www.monoslideshow.com/)
 * Plupload (http://www.plupload.com/) by Moxicode Systems
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * jquery a JavaScript Library (http://jquery.com/)
 * getid3 library (http://getid3.sourceforge.net/)
 * swfobject is an easy-to-use and standards-friendly method to embed Flash content, which utilizes one small JavaScript file (http://code.google.com/p/swfobject/)
 * Chained Selects jQuery Plugin (http://www.appelsiini.net/2010/jquery-chained-selects)
 *
 * Jmonoslideshow is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
$user		= JFactory::getUser();
$userId		= $user->get('id');
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
$ordering 	= $this->state->get('list.ordering')=='ordering';
$n			= count($this->items);
?>
<?php foreach($this->items as $i => $item):
		$ordering	= ($listOrder == 'ordering');
		$canCreate	= $user->authorise('core.create',		'com_jmonoslideshow.slideshow.'.$item->id);
		$canEdit	= $user->authorise('core.edit',			'com_jmonoslideshow.slideshow.'.$item->id);
		$canCheckin	= $user->authorise('core.manage',		'com_jmonoslideshow') || $item->checked_out == $userId || $item->checked_out == 0;
		$canChange	= $user->authorise('core.edit.state',	'com_jmonoslideshow.slideshow.'.$item->id) && $canCheckin;
?>
		<tr class="row<?php echo $i % 2; ?>">
		<td>
			<?php echo $this->pagination->getRowOffset( $i ); ?>
		</td>
		<td>
			
			<?php echo JHtml::_('grid.id', $i, $item->id); ?>
		</td>
		<td>
		<div class="tags">
			<?php if ($canEdit || $canEditOwn){ ?>
				
				<a href="<?php //echo JRoute::_('index.php?option=com_jmonoslideshow&task=tag.edit&id='.$item->id); ?>">
				
				
					<?php echo $this->escape($item->name); ?>
					</a>
					
				<?php } else { 
				
					echo $this->escape($item->name);
					
					} ?>
		</div>
			</td>
		
		
		<td align="center">
			<a href="index.php?option=com_jmonoslideshow&view=medias&filter_category_id=-1&filter_author_id=&filter_search=<?php echo $this->escape($item->name); ?>"><?php echo $item->total; ?></a>
		</td>
	</tr>
<?php endforeach; ?>